/**
 * @file       IEvent.cpp
 * @brief      TODO
 * @author     Huabo Zheng
 * @date       Jan 13, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#include "IEvent.h"
#include "typedefine.h"
#include "Frame.h"
#include <ctime>

namespace NS_LCD_AFW
{

IEvent::IEvent() :
		m_nEventType(NOTIFY_EVENT), m_nEventCode(UN_KNOW_EVENT_CODE), m_nEventId(
				INVALID_EVENT_ID), m_eventParam(INVALID_PARAM), m_nOccurTime(
				INVALID_TIME), m_point(INVALID_POSITION, INVALID_POSITION)

{
	init();
}

IEvent::~IEvent()
{
}

IEvent::Param IEvent::getParam() const
{
	return this->m_eventParam;
}

IEvent::EventCode IEvent::getCode() const
{
	return this->m_nEventCode;
}

int IEvent::getEventId() const
{
	return this->m_nEventId;
}

IEvent::EventType IEvent::getType() const
{
	return this->m_nEventType;
}

time_t IEvent::getOccurTime() const
{
	return this->m_nOccurTime;
}

CPoint IEvent::getPoint() const
{
	return this->m_point;
}

void IEvent::setParam(Param eventParam)
{
	m_eventParam = eventParam;
}

void IEvent::setCode(IEvent::EventCode eventCode)
{
	m_nEventCode = eventCode;
}

void IEvent::setEventId(int nEventId)
{
	m_nEventId = nEventId;
}

void IEvent::setType(EventType nEventType)
{
	m_nEventType = nEventType;
}

void IEvent::setOccurTime(time_t nOccurTime)
{
	m_nOccurTime = nOccurTime;
}

void IEvent::setPoint(CPoint point)
{
	m_point = point;
}

void IEvent::init()
{
	m_nOccurTime = time(NULL);

	//TODO: get the cursor point here
}

void IEvent::destory()
{
	delete this;
}

} /* namespace NS_LCD_AFW */
